package com.ptszyxx.popose.module.main.user.provider;

import androidx.annotation.NonNull;
import com.github.gzuliyujiang.wheelpicker.contract.LinkageProvider;
import com.ysg.http.data.entity.user.UserWorkEntity;
import com.ysg.http.data.entity.user.UserWorkItemEntity;
import java.util.ArrayList;
import java.util.List;

public class UserWorkProvider implements LinkageProvider {
    private List<UserWorkEntity> list;
    public UserWorkProvider(List<UserWorkEntity> list) {
        this.list = list;
    }

    @Override
    public boolean firstLevelVisible() {
        return true;
    }

    @Override
    public boolean thirdLevelVisible() {
        return false;
    }

    @NonNull
    @Override
    public List<String> provideFirstData() {
        List<String> firstList = new ArrayList<>();
        for (UserWorkEntity item: list ) {
            firstList.add(item.getName());
        }
        return firstList;
    }

    @NonNull
    @Override
    public List<String> linkageSecondData(int firstIndex) {
        List<String> secondList = new ArrayList<>();
        UserWorkEntity userWorkEntity = list.get(firstIndex);
        for (UserWorkItemEntity item: userWorkEntity.getZhiyeList()) {
            secondList.add(item.getName());
        }
        return secondList;
    }

    @NonNull
    @Override
    public List<?> linkageThirdData(int firstIndex, int secondIndex) {
        return null;
    }

    @Override
    public int findFirstIndex(Object firstValue) {
        return 0;
    }

    @Override
    public int findSecondIndex(int firstIndex, Object secondValue) {
        return 0;
    }

    @Override
    public int findThirdIndex(int firstIndex, int secondIndex, Object thirdValue) {
        return 0;
    }
}
